package com.amado.course51regex;

import java.util.regex.Pattern;

public class RegexTest {
	public static void main(String[] args) {
		String regex = "\\w+([-+.]\\w+)*@\\w+([-.]\\w+)*\\.\\w+([-.]\\w+)*";
		System.out.println(Pattern.matches(regex, "39222@qq.com"));
		System.out.println(Pattern.matches(regex, "39222qq.com"));
		System.out.println(Pattern.matches(regex, "39222@qqcom"));
		
		System.out.println("39222@qq.com".matches(regex));
		System.out.println("39222qq.com".matches(regex));
		System.out.println("39222@qqcom".matches(regex));
	}
}
